package com.ethan.blog.common.constant;

/**
 * @author: Ethan
 * @Time: 2024/5/24 20:05
 * @description: 状态码常量类
 */
public class StatusCodeConstant {
    /**
     * 操作类状态码
     */
    public static final Integer SUCCESS_CODE = 1;   // 成功状态码
    public static final Integer ERROR_CODE = 0;     // 失败状态码

    /**
     * 登录方式状态码
     *  TODO：设计枚举
     *  public static final String LOGIN_ACCOUNT = "账号登录";
     *  public static final String LOGIN_WECHAT = "微信登录";
     *  public static final String LOGIN_ACCOUNT_PHONE = "手机账号登录";
     *  public static final String LOGIN_SMS_PHONE = "手机短信登录";
     *  public static final String LOGIN_EMAIL = "邮箱登录";
     */
    public static final Integer LOGIN_ACCOUNT_CODE = 0;
    public static final Integer LOGIN_WECHAT_CODE = 1;
    public static final Integer LOGIN_ACCOUNT_PHONE_CODE = 2;
    public static final Integer LOGIN_SMS_PHONE_CODE = 3;
    public static final Integer LOGIN_EMAIL_CODE = 4;

    /**
     * 校验规则 TODO: 更换校验规则
     */
    public static final String LOGIN_MULTI_TYPE_VALIDATION_PATTERN = "^(^1[3-9]\\d{9}" +
            "|" + "[a-zA-Z0-9_]{8,16}" +
            "|" + "[a-zA-Z0-9_.]+@[a-zA-Z0-9-]+(\\.[a-zA-Z0-9-]+)*\\.[a-zA-Z]{2,6})$";
    public static final String LOGIN_ACCOUNT_PATTERN = "^[a-zA-Z0-9_]{8,16}$";
    //    public static final String LOGIN_WECHAT_CODE = "...";
    public static final String LOGIN_ACCOUNT_PHONE_PATTERN = "^1[3-9]\\d{9}$";
    public static final String LOGIN_PHONE_PATTERN = "^1[3-9]\\d{9}$";
    public static final String LOGIN_EMAIL_PATTERN = "^[a-zA-Z0-9_-]+@[a-zA-Z0-9_-]+(\\.[a-zA-Z0-9_-]+)+$";
    public static final String LOGIN_PASSWORD_PATTERN = "^[a-zA-Z0-9_]{8,16}$";

    /**
     * 其他状态码
     */
    // 创建人ID
    public static final Long USER_BY_ID = 0L;
    // 是否删除
    public static final Integer IS_DELETE_NO = 0;
    public static final Integer IS_DELETE_YES = 1;
    // 权限级别
    public static final Integer AUTHORITY_LEVEL_USER = 0;
    public static final Integer AUTHORITY_LEVEL_ADMIN = 1;
}
